package com.longshanks.retrorally;

import android.util.Log;

public class MathHelper {
	
	public static final String TAG = MathHelper.class.getSimpleName();

	public static int clamp(int value, int min, int max) {
		int ret = Math.max(min, Math.min(value, max));
		Log.d(TAG, "value: " + value + " min: " + min + " max: " + max + " returning: " + ret);
		return Math.max(min, Math.min(value, max));
	}
	
	public static boolean isFloatEquals(float first, float second) {
		return (Math.abs(first/second) - 1) < 0.000001;
	}
}
